{include file="header"}
<div style="padding: 20px;">
<form class="layui-form layui-form-pane" action="">
<input type="hidden" name="id" value="{$id}">	
<div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
  <div class="layui-tab-content">
  	
  <div class="layui-form-item">
    <label class="layui-form-label">标题</label>
    <div class="layui-input-block">
      <input type="text" name="title" value="{$c['title']}" required  lay-verify="required" placeholder="请输入名称" autocomplete="off" class="layui-input">
    </div>
  </div>
  	
  	
  <div class="layui-form-item">
    <label class="layui-form-label">页面显示</label>
    <div class="layui-input-block">
      <input type="radio" name="open" value="1" title="显示" {if condition="$c['open'] eq 1"}checked{/if}>
      <input type="radio" name="open" value="0" title="关闭" {if condition="$c['open'] eq 0"}checked{/if}>
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">邮件通知</label>
    <div class="layui-input-block">
      <input type="radio" name="mail" value="1" title="显示" {if condition="$c['mail'] eq 1"}checked{/if}>
      <input type="radio" name="mail" value="0" title="关闭" {if condition="$c['mail'] eq 0"}checked{/if}>
    </div>
  </div>
    <div class="layui-col-md3"> 
  <div class="layui-form-item">
    <label class="layui-form-label">别名</label>
    <div class="layui-input-block">
      <input type="text" name="show" value="{$c['show']}" required  lay-verify="required" placeholder="请输入别名" autocomplete="off" class="layui-input">
    </div>
  </div>
  </div>
  <div class="layui-col-md2">    
  <div class="layui-form-item">
    <label class="layui-form-label">留言积分</label>
    <div class="layui-input-block">
      <input type="number" name="jifen" value="{$c['jifen']}" autocomplete="off" class="layui-input">
    </div>
  </div>
 </div>
   <div class="layui-col-md2">    
  <div class="layui-form-item">
    <label class="layui-form-label">一天评论</label>
    <div class="layui-input-block">
      <input type="number" name="pl" value="{$c['pl']}" autocomplete="off" class="layui-input">
    </div>
  </div>
 </div>
  <div class="layui-form-item">
    <label class="layui-form-label">模板文件</label>
    <div class="layui-input-block">
      <input type="text" value="{$c['name']}" name="name"  required  lay-verify="required" placeholder="请输入名称" autocomplete="off" class="layui-input">
    </div>
  </div>
  <div class="layui-form-item">
      <input id="form-keywords" name="keywords" type="text" placeholder="seo优化关键字回车提交"  value="{$c['keywords']}">
  </div>
  <div class="layui-form-item layui-form-text">
    <label class="layui-form-label">描述</label>
    <div class="layui-input-block">
      <textarea name="description" id="description" placeholder="seo优化描述" class="layui-textarea">{$c['description']}</textarea>
    </div>
  </div> 
  <div class="layui-form-item">
  	{include file="app/admin/view/editor.html"}
   </div>
 
 
  <div class="layui-form-item">
    <div class="layui-input-block">
      <button class="layui-btn" lay-submit lay-filter="myucms">立即提交</button>
      <button type="reset" class="layui-btn layui-btn-primary">重置</button>
    </div>
  </div>
	
</form>
      
<div>
{include file="footer"}
<link rel="stylesheet" type="text/css" href="*ADMIN*/css/tag.css" />
<script type="text/javascript" src="*ADMIN*/css/tag.js"></script>
<script type="text/javascript">
		$(function() {
			$('#form-keywords').tagsInput({
				'onAddTag': function(input, value) {
					console.log('tag added', input, value);
				},
				'onRemoveTag': function(input, value) {
					console.log('tag removed', input, value);
				},
				'onChange': function(input, value) {
					console.log('change triggered', input, value);
				}
			});
		});
	</script>
<script >
var editor;
var layedit;
layui.use(['layedit', 'form', 'upload'],
function() {
    var form = layui.form,
    upload = layui.upload,
    jq = layui.jquery,
    layedit = layui.layedit;
    layedit.set({
        uploadImage: {
            url: '{:url('upimg/up')}',
            accept: 'image',
            acceptMime: 'image/*',
            exts: 'jpg|png|gif|bmp|jpeg',
            size: '10240'
        }
        , uploadVideo: {
            url: '{:url('upimg/up')}',
            accept: 'video',
            acceptMime: 'video/*',
            exts: 'mp4|flv|avi|rm|rmvb',
            size: '20480'
        }
        , calldel: {
            url: '{:url('upimg/up')}'
        }
        ,devmode: false
        , codeConfig: {
            hide: true
        ,default:
            '115CMS.COM' 
        }
        ,tool: ['html', 'code', 'strong', 'italic', 'underline', 'del', 'addhr', '|', 'fontFomatt', 'colorpicker', 'face', '|', 'left', 'center', 'right', '|', 'link', 'unlink', 'image_alt', 'video', 'anchors', '|', 'fullScreen'],
        height: '300'
    });
    editor = layedit.build('content');
    form.verify({
        content: function(value) {
            return layedit.sync(editor);
        },
    });
    form.on('submit(myucms)',
    function(data) {
        loading = layer.load(2, {
            shade: [0.2, '#000']
        });
        var param = data.field;
        jq.post("{:url("danye/update")}", param,
        function(data) {
            if (data.code == 1) {
                layer.close(loading);
                layer.msg(data.msg, {
                    icon: 1,
                    time: 1000
                },
                function() {
                    location.reload();
                });
            } else {
                layer.close(loading);
                layer.msg(data.msg, {
                    icon: 2,
                    anim: 6,
                    time: 1000
                });
            }
        });
        return false;
    });
})
var tag = new Tag("tagValue");
tag.initView();
</script>
